import requests
import random
from UA_info import UA_list


def run(player_name):
    url = 'https://minotar.net/skin/{}'
    headers = {'User-Agent': random.choice(UA_list)}
    response = requests.get(url=url.format(player_name), headers=headers)
    with open('skin.png', 'wb') as image:
        image.write(response.content)


if __name__ == '__main__':
    player_name = input('Please input your name in Minecraft: ')
    run(player_name)
